using System.Collections.Generic;

namespace Magiq.Tests.TestModel
{
    public class CompositePkTestDomain<TParent, TChild>
        where TParent : class,ICompositePkParent<TChild>, new()
        where TChild : class,ICompositePkChild, new()
    {
        public CompositePkTestDomain()
        {
            Parents = new List<TParent>();
            Children = new List<TChild>();

            for (var i = 0; i < 15; i++)
            {
                Children.Add(new TChild
                                 {
                                     Prop = "test" + i,
                                     Id1 = i,
                                     Id2 = i + 3
                                 });
            }

            for (var i = 8; i < 15; i++)
            {
                Parents.Add(new TParent
                                {
                                    Prop = "sarasa" + i,
                                    Child = Children[i],
                                });
            }
            Parents.Add(new TParent
                            {
                                Prop = "sarasa",
                            });
        }

        public List<TParent> Parents { get; private set; }

        public List<TChild> Children { get; private set; }
    }
}